const FileHandler = require('./FileHandler');
const fileHandler = new FileHandler('../data');
function generateURLArray(arr) {
    const result = [];
    const baseUrl = 'https://www.xiaohongshu.com/explore/';

    for (let i = 0; i < arr.length; i += 30) {
        console.log('开始 === ' + i)
        console.log(arr.slice(i, i + 30).map(item => {
            console.log(baseUrl + item)
        }))
        console.log('结束 ===' + i)
        result.push(arr.slice(i, i + 30).map(item => baseUrl + item));
    }

    return result;
}

fileHandler.readFile('重庆旅游', (type, data) => {
    const newData = generateURLArray(data);
    // console.log(newData)
})